const createLinkedList = require('../utils/createLinkList')
var reverseList = function(head) {
    let pre = null
    let current = head
    while(current!==null){
        let next = current.next
         current.next=pre
         pre = current
         current =next
    }
    return pre
}
const head = createLinkedList([1,2,3,4,5])
const result = reverseList(head)


module.exports.reverseList = reverseList